Skip to content

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Dec 24, 2025

Description

Framework level improvements for for contextual and localized API error messages

Design spec: Error Message Consistency, Customization, and Localization Framework

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Refined error message with additional context for admin
image

User facing error, with localization
image

Example API response

{
    "deployvirtualmachineresponse": {
        "uuidList": [],
        "errorcode": 535,
        "cserrorcode": 9999,
        "errortext": "Unable to deploy Instance because allocating 1 more Instance would exceed the Account limits. Current: 2, Reserved: 0, Limit: 2. Release unused resources, then retry.",
        "errortextkey": "vm.deploy.resourcelimit.exceeded.account",
        "errormetadata": {
            "resourceRequested": "1",
            "resourceTypeDisplay": "Instance",
            "resourceOwnerType": "Account",
            "resourceAmount": "2",
            "resourceReserved": "0",
            "resourceLimit": "2"
        }
    }
}

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

❌ Patch coverage is 60.24465% with 130 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.62%. Comparing base (2d4b7ba) to head (5c8d2c9).

Files with missing lines Patch % Lines
...pache/cloudstack/context/ErrorMessageResolver.java 82.73% 13 Missing and 16 partials ⚠️
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 11.53% 21 Missing and 2 partials ⚠️
...ava/org/apache/cloudstack/context/CallContext.java 26.92% 17 Missing and 2 partials ⚠️
.../cloud/resourcelimit/ResourceLimitManagerImpl.java 0.00% 19 Missing ⚠️
...he/cloudstack/api/command/user/vm/DeployVMCmd.java 0.00% 10 Missing ⚠️
.../org/apache/cloudstack/api/ServerApiException.java 0.00% 7 Missing ⚠️
...c/main/java/com/cloud/user/AccountManagerImpl.java 50.00% 4 Missing and 3 partials ⚠️
...m/cloud/utils/exception/CloudRuntimeException.java 53.84% 6 Missing ⚠️
...rc/main/java/com/cloud/configuration/Resource.java 86.36% 3 Missing ⚠️
...loudstack/api/command/user/vm/BaseDeployVMCmd.java 0.00% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #12336      +/-   ##
============================================
+ Coverage     17.59%   17.62%   +0.02%     
- Complexity    15596    15640      +44     
============================================
  Files          5910     5911       +1     
  Lines        529634   529923     +289     
  Branches      64714    64756      +42     
============================================
+ Hits          93176    93381     +205     
- Misses       425968   426031      +63     
- Partials      10490    10511      +21     
Flag Coverage Δ
uitests 3.58% <ø> (+<0.01%) ⬆️
unittests 18.69% <60.24%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Framwork level improvements for for contextual and localized API error
messages

More details to be added

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr shwstppr closed this Jan 6, 2026
@shwstppr shwstppr reopened this Jan 6, 2026
@apache apache deleted a comment from blueorangutan Jan 6, 2026
@apache apache deleted a comment from blueorangutan Jan 6, 2026
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@apache apache deleted a comment from blueorangutan Jan 6, 2026
@apache apache deleted a comment from blueorangutan Jan 6, 2026
@shwstppr
Copy link
Contributor Author

shwstppr commented Jan 6, 2026

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants